<?php
 require "../document/class_corpus.php";
 require "../document/class_document.php";
 require "../document/class_document_xml.php";

 require "../files/tool_files_dirs.php";

 require "../misc/class_tag.php";

 require "../tree/class_tree.php";
 require "../tree/class_tree_xhtml.php";
 require "../tree/class_structure.php";
 require "../tree/tool_tree.php";

 require "../array/tool_array.php";

 require "../maths/tool_maths.php";
 require "../pear_graph/tool_pear_graph.php";

 require "./tool_string.php";
 require "./class_segment.php";


 $corpus=tool_corpus::get_corpus_regexp("../xml/europa/","fr.xml");
// $corpus=tool_corpus::get_corpus_regexp("../xml/europa/",".fr.xml");
// $corpus=tool_corpus::get_corpus_regexp("../xml/test/",".fr.xml");
 $array_doc=$corpus->__get_array_doc();
// $document=$array_doc[0];
// echo count($array_doc);
//die();

//die();

$res_x=$res_y=array();
foreach($array_doc as $document){
$factory_mot=new factory_mot();
  $structure=$document->__get_structure();
  $signature=$structure->__get_signature();
  tool_tree::cleanstructure(&$signature);
  $signature->__recalc_idn();
  $test=new RecursiveIteratorIterator($signature,RecursiveIteratorIterator::SELF_FIRST);
  $mb_len=0;
    foreach($test as $bloc_xhtml){
      $texte=tool_tree::tree_xhtml2texte($bloc_xhtml->__get_value());
      $id=$factory_mot->get_all_mots($texte);
      $mb_len+=mb_strlen($texte);
    }
$time_start = microtime(true);
$factory_mot->init_etiquetage();
$factory_mot->init_chunk();
$time_end = microtime(true);
$time=$time_end-$time_start;
$res_y[]=round($time,2);
$res_x[]=$mb_len;
 }
$graph=Tool_pear_graph::plot01($res_x,$res_y);
$graph->done();
?>
